index.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { useParams } from 'common'
  2. import { useRouter } from 'next/router'
  3. import { useEffect } from 'react'
  4. import { PageContainer } from 'ui-patterns/PageContainer'
  5. import { PageSection, PageSectionContent } from 'ui-patterns/PageSection'
  6. import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
  7. import { DefaultLayout } from '@/components/layouts/DefaultLayout'
  8. import { ProjectIntegrationsLayoutDispatch } from '@/components/layouts/ProjectIntegrationsLayoutDispatch'
  9. import type { NextPageWithLayout } from '@/types'
  10. const IntegrationPage: NextPageWithLayout = () => {
  11. const router = useRouter()
  12. const { ref, id } = useParams()
  13. useEffect(() => {
  14. // Always redirect to the overview page since this route should not render content
  15. if (router?.isReady) {
  16. router.replace(`/project/${ref}/integrations/${id}/overview`)
  17. }
  18. }, [router, ref, id])
  19. return (
  20. <PageContainer size="full">
  21. <PageSection>
  22. <PageSectionContent>
  23. <GenericSkeletonLoader />
  24. </PageSectionContent>
  25. </PageSection>
  26. </PageContainer>
  27. )
  28. }
  29. IntegrationPage.getLayout = (page) => (
  30. <DefaultLayout>
  31. <ProjectIntegrationsLayoutDispatch>{page}</ProjectIntegrationsLayoutDispatch>
  32. </DefaultLayout>
  33. )
  34. export default IntegrationPage